import Vue from 'vue'
import App from './App'
import router from './router'
import api from './api/index.js'
import store from './store'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css'// progress bar style
import '../static/css/iconfont.css'

//使用element-ui
import eleUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'element-ui/lib/theme-chalk/reset.css'
Vue.use(eleUI, { size: 'small', zIndex: 3000 });

import TreeDialog from './plugins/index.js'
Vue.prototype.$tree = TreeDialog.install;

NProgress.configure({ showSpinner: false })

//关闭控制台多余提示
Vue.config.productionTip = false;
Vue.config.silent = true;

//配置是否允许 vue-devtools 检查代码。开发版本默认为 true，生产版本默认为 false。生产版本设为 true 可以启用检查。
Vue.config.devtools = true

Vue.prototype.$api = api  //其他页面调用  this.$api. ...

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>',
})

router.beforeEach((to, from, next) => {
  NProgress.start() // start progress bar
  next();
})

router.afterEach(() => {
  NProgress.done() // finish progress bar
})

console.warn("=========一体化管理系统=========\n" + process.env.ROOT);